
<html lang="zh">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>YXB</title>
    
        <style type="text/css">
            * {
                margin: 0;
                padding: 0;
            }
            body{
                max-width:640px;
                min-width:320px;
                border:green solid 1px;
                margin:0 auto;
            }
    
    
    
    
    /*        方案1 :  固定失败          */
            /* #Root{
                position: fixed;
            }
            footer{
                border: red solid 1px;
                width: 100%;
                position: relative;
            } */
    
    
    
    /*        方案1 :  固定成功          */
            footer{
                border: red solid 1px;
                width: 640px;
                position: fixed;
                /* position: relative; */
                bottom: 0;
            }
    
            .nav_left {
                    display: flex;
                    width: 40%;
                    text-align: center;
                    background-color: pink;
            }
            .shop_and_cart {
                margin: 10px auto;
            }
            .img_pic {
                  margin: 1px auto;
                  width: 20px;
                  height: 20px;
            }
            .img_pic img {
                width: 100%;
                height: 100%;
            }
    
    
            .nav_right {
              width: 60%;
              height: 100%;
              position: absolute;
              top: 0;
              right: 0;
            }
            #buy_now {
                width: 50%;
                height: 100%;
                background-color: rgb(255, 190, 35);
                border: 0;
                outline: none;
            }
            #Add_to_shoppingCart {
                width: 50%;
                height: 100%;
                float: right;
                background-color: rgb(243, 85, 75);
                border: 0;
                outline: none;
            }
        </style>
    </head>
    
    <body>
    
        <h1>position: fixed; bottom: 0; 固定在底部失败.... </h1>
        <h1>  关键性代码: </h1>
        <h1>footer 设置 width: 640px;   撑开整个 footer </h1>
        <h2> img 使用:  data:image/png;base64 </h2>
    
    
        <div id="Root">
            <footer>
                <div class="nav_left">
                    <div class="shop_and_cart">
                        <div class="img_pic">
                            <img
                                src="">
                        </div>
                        <div class="word">购物车</div>
                    </div>
                    <div class="shop_and_cart">
                        <div class="img_pic">
                            <img
                                src="">
                        </div>
                        <div class="word">店铺</div>
                    </div>
                </div>
    
                <div class="nav_right">
                    <button id="buy_now">立即购买</button>
                    <button id="Add_to_shoppingCart">加入购物车</button>
                </div>
            </footer>
        </div>
    
    
    <p>123123123</p>
    
    <p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p><p>123123123</p>
    
    
    </body>
    
    <script type="text/javascript" src=""></script>
    <script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
    
    </html>
    
    